//
//  ZTXNewLinesCell.m
//  NtoccShipper
//
//  Created by 张天兴 on 2023/8/31.
//  Copyright © 2023 zhuchongjin. All rights reserved.
//

#import "ZTXNewLinesCell.h"

@implementation ZTXNewLinesCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setCellInfoWithSourceModel:(LinesListModel *)model{
    self.zhAddressLabel.text = CJStringWithFormat(@"%@%@",model.shipperAddress,model.shipperDetailAddress);
    self.xhAddressLabel.text = CJStringWithFormat(@"%@%@",model.consigneeAddress,model.consigneeDetailAddress);
    self.nameLabel.text = model.consigneeName;
    self.phoneLabel.text = model.consigneePhone;
    if([model.isTrunk isEqualToString:@"0"]){
//        0-元/吨，1-元/方，2-元/件，3-元/车
        self.moneyLabel.text = CJStringWithFormat(@"¥%.@元/吨",model.price);
    }else if ([model.isTrunk isEqualToString:@"1"]){
        self.moneyLabel.text = CJStringWithFormat(@"¥%.@元/方",model.price);
    }else if ([model.isTrunk isEqualToString:@"2"]){
        self.moneyLabel.text = CJStringWithFormat(@"¥%.@元/件",model.price);
    }else{
        self.moneyLabel.text = CJStringWithFormat(@"¥%.@元/车",model.price);
    }
    if ([model.endType isEqualToString:@"0"]) {
        self.overTimeLabel.text = @"永不结束";
    }else if ([model.endType isEqualToString:@"1"]){
        self.overTimeLabel.text = CJStringWithFormat(@"%@ 结束",[model.endTime substringToIndex:10]);
    }else{
        self.overTimeLabel.text = CJStringWithFormat(@"剩余%d次 结束",model.remainTime);
    }
    if(model.isStop == 1){
        self.stopImagView.hidden = NO;
        [self.stopButton setTitle:@"已停用" forState:(UIControlStateNormal)];
    }else{
        self.stopImagView.hidden = YES;
        [self.stopButton setTitle:@"停用" forState:(UIControlStateNormal)];
    }
    
}

@end
